package ecom.appcode.common.daobean;

import java.util.HashMap;

public class ShopDaoBean extends HashMap {

    public ShopDaoBean() {
        super();
    }

    public void addShoes(ShoesDaoBean shoes) {
        int key = shoes.getShoesID();
        if(this.containsKey(key)){
            int oldQuantity = ((ShoesDaoBean)this.get(key)).getQuantity();
           ((ShoesDaoBean)this.get(key)).setQuantity(oldQuantity + 1);
        } else {
            this.put(shoes.getShoesID(), shoes);
        }
    }
    
    public boolean removeShoes(int shoesID){
        if(this.containsKey(shoesID)){
            this.remove(shoesID);
            return true;
        }
        return false;
    }
}
